#pragma once
#include <iostream>
#include <unistd.h>
#include <string>

static const int defaultValue = 0;
static const std::string str = "+-";

class Task
{
public:
    Task(){}
    Task(int x, int y, char op)
    :_x(x), _y(y), _op(op), _result(defaultValue)
    {}

    void Run()
    {
        switch(_op)
        {
            case '+':
                _result = _x + _y;
                break;
            case '-':
                _result = _x - _y;
                break;
            default:
                std::cout << "op is error" << std::endl;
                break;
        }
    }
    void operator()()
    {
        Run(); 
        std::cout << _x  << _op << _y << "=" << _result << std::endl;
        sleep(2);
    }
    ~Task()
    {}
private:
    int _x;
    int _y;
    char _op;
    int _result;
};